Transfer Docker image to other server without remote repository

I build my websites with NodeJS and create production ready apps with Docker. These images are usually unique the client and contain sensitive information.

My production server is an Intel NUC. Enough power to drive a few websites, but chugs along when I try to build an image. Why not build the image on my MacBook Pro M1 Laptop or Ryzen 5 5600x Custom PC with ease, then transfer the image over?

tutorial

In order to transfer a Docker image from one server to another, what you need to do is first export the image to a file, then copy that file over from your current server to the new one using scp or rsync and finally load the image to your new server. Here’s how to do that:

sudo docker save -o /home/sammy/your_image.tar your_image_name

Copy

ls -lah /home/sammy/your_image.tar

Copy

https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories

In case that you decide to use rsync as well, to copy the file over run the following command:

rsync -avz /home/sammy/your_image.tar username@remote_server_ip_address:destination_directory
Note

make sure to change the destination_directory, the username and the remote_server_ip_address with your actual details

sudo docker load -i your_image.tar 

Copy

sudo docker images

Credits